const { Page } = require('@playwright/test');

class LoginPage {
    constructor(page) {
        this.page = page;
    }

    async GPOOpen(address) {
        // 锁定http
        // self.page.set_extra_http_headers({'ignore-ssl-errors': 'true'})
        // print(address)
        await this.page.goto(address);
    }

    async enterUsername(username) {
        await this.page.fill('#username', username);
    }

    async enterPassword(password) {
        await this.page.fill('#password', password);
    }

    async clickLoginButton() {
        await this.page.click('#loginIn');
    }

    async singleSignOn() {
        await this.page.getByText('当前电脑用户直接登录').click();
    }
}

module.exports = {
    LoginPage
};
